stylecontext: Deprecate functions
authorBenjamin Otte <otte@redhat.com>
Fri, 3 Oct 2014 03:52:49 +0000 (05:52 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 3 Oct 2014 04:18:06 +0000 (06:18 +0200)
- gtk_style_context_get_background_color()
- gtk_style_context_get_border_color()

Those functions shouldn't be used anymore, because they don't represent
anything from the CSS styling we support. The background color often
isn't used due to background images and there are actually 4 different
border colors (1 for each side) - if there isn't also a border image in
use.

gtk/gtkcolorswatch.c
gtk/gtkentry.c
gtk/gtkflowbox.c
gtk/gtkpopover.c
gtk/gtkstylecontext.c
gtk/gtkstylecontext.h
gtk/gtktextdisplay.c
gtk/gtktextutil.c
gtk/gtktextview.c

index 05b6c81af950ff4434ba7b2607a78031a5fd5ca7..9218a2c731a0444ae266a7c82ff738463ff23ce1 100644 (file)
@@ -206,8 +206,10 @@ swatch_draw (GtkWidget *widget,
         }
       else
         {
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
           gtk_style_context_get_background_color (context, state, &bg);
           gtk_style_context_get_border_color (context, state, &border);
+G_GNUC_END_IGNORE_DEPRECATIONS
           gtk_style_context_get_border (context, state, &border_width);
 
           cairo_new_sub_path (cr);
index 0c10e747bda528181a3b75d64974fe65d4914f93..48a38b822cc754b7d599de240765a31c00875a66 100644 (file)
@@ -6422,7 +6422,9 @@ draw_text_with_color (GtkEntry *entry,
       state = gtk_widget_get_state_flags (widget);
       state |= GTK_STATE_FLAG_SELECTED;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       gtk_style_context_get_background_color (context, state, &selection_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
       gtk_style_context_get_color (context, state, &text_color);
 
       for (i = 0; i < n_ranges; ++i)
@@ -6594,7 +6596,9 @@ gtk_entry_draw_cursor (GtkEntry  *entry,
           GdkRGBA color;
 
           state = gtk_widget_get_state_flags (widget);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
           gtk_style_context_get_background_color (context, state, &color);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
           gdk_cairo_rectangle (cr, &rect);
           cairo_clip (cr);
index e8374e903142934e8d084890193b84371709d581..9e9e840145a5aa02c8c8210ca53ad4f9696b2b41 100644 (file)
@@ -2614,7 +2614,9 @@ gtk_flow_box_draw (GtkWidget *widget,
           cairo_path_destroy (path);
 
           state = gtk_widget_get_state_flags (widget);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
           gtk_style_context_get_border_color (context, state, &border_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
           gtk_style_context_get_border (context, state, &border);
 
           cairo_set_line_width (cr, border.left);
index 65e1b05841a08a2bf4ce5dd91a5b1449784a0e10..0106c65bf62ac4775db5aeacfd1856df6c9e8b2e 100644 (file)
@@ -898,7 +898,9 @@ gtk_popover_draw (GtkWidget *widget,
   /* Render the border of the arrow tip */
   if (border.bottom > 0)
     {
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       gtk_style_context_get_border_color (context, state, &border_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
       gtk_popover_apply_tail_path (popover, cr);
       gdk_cairo_set_source_rgba (cr, &border_color);
 
index f0a0c8e83838d26a3697c3b53a96bfc84c282e11..e62a185fedac85dc8197e5ca18251530feb63a36 100644 (file)
@@ -3499,7 +3499,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS
       {
         GdkRGBA bg;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
         gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
         color->red = (color->red + bg.red) * 0.5;
         color->green = (color->green + bg.green) * 0.5;
@@ -3890,7 +3892,9 @@ _gtk_style_context_get_attributes (AtkAttributeSet *attributes,
   GdkRGBA color;
   gchar *value;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_style_context_get_background_color (context, flags, &color);
+G_GNUC_END_IGNORE_DEPRECATIONS
   value = g_strdup_printf ("%u,%u,%u",
                            (guint) ceil (color.red * 65536 - color.red),
                            (guint) ceil (color.green * 65536 - color.green),
index 653a52c67f19e7ee2c128d691246c3ffd5222733..6184d84096142e6fa94d9cb9ea8f9b4cd40c0413 100644 (file)
@@ -1083,11 +1083,11 @@ GDK_AVAILABLE_IN_ALL
 void gtk_style_context_get_color            (GtkStyleContext *context,
                                              GtkStateFlags    state,
                                              GdkRGBA         *color);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16_FOR(gtk_render_background)
 void gtk_style_context_get_background_color (GtkStyleContext *context,
                                              GtkStateFlags    state,
                                              GdkRGBA         *color);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16_FOR(gtk_render_frame)
 void gtk_style_context_get_border_color     (GtkStyleContext *context,
                                              GtkStateFlags    state,
                                              GdkRGBA         *color);
index 9e8fceac5bbfd2078bb4d381c006d8c422a9960c..420db81fff9503611840af28151f3c59ccda330d 100644 (file)
@@ -591,7 +591,9 @@ render_para (GtkTextRenderer    *text_renderer,
 
   state |= GTK_STATE_FLAG_SELECTED;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_style_context_get_background_color (context, state, &selection);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   do
     {
@@ -783,7 +785,9 @@ render_para (GtkTextRenderer    *text_renderer,
                   GdkRGBA color;
 
                   state = gtk_widget_get_state_flags (text_renderer->widget);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
                   gtk_style_context_get_background_color (context, state, &color);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
                   gdk_cairo_set_source_rgba (cr, &color);
 
index 32b41ae37b4b9ea495421e2ee350b988856ae32a..2ccd48c0801ed9331b4322d69fa0221bf92f97a4 100644 (file)
@@ -270,7 +270,9 @@ gtk_text_view_set_attributes_from_style (GtkTextView        *text_view,
   context = gtk_widget_get_style_context (GTK_WIDGET (text_view));
   state = gtk_widget_get_state_flags (GTK_WIDGET (text_view));
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_style_context_get_background_color (context, state, &bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
   gtk_style_context_get_color (context, state, &fg_color);
 
   values->appearance.bg_color.red = CLAMP (bg_color.red * 65535. + 0.5, 0, 65535);
index 59dcf76308be9df66fdc55d0cf9e7b2fefb8eca0..15433366fab00a4dd6ba12cf34680301f3f07d70 100644 (file)
@@ -7259,7 +7259,9 @@ gtk_text_view_set_attributes_from_style (GtkTextView        *text_view,
   gtk_style_context_save (context);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_style_context_get_background_color (context, state, &bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
   gtk_style_context_get_color (context, state, &fg_color);
 
   values->appearance.bg_color.red = CLAMP (bg_color.red * 65535. + 0.5, 0, 65535);